<template>
	<view>
		<piaoyiEditor :values="props.modelValue" :placeholder="props.placeholder" :maxlength="3000" @changes="saveContens"
			:readOnly="readOnly" :photoUrl="photoUrl" :api="api" name="file" />
	</view>
</template>

<script setup lang="ts">
	import piaoyiEditor from '@/uni_modules/piaoyi-editor/components/piaoyi-editor/piaoyi-editor.vue';
	import config from '@/config';

	interface Props {
		modelValue : string,
		placeholder ?: string,
	}
	const emit = defineEmits(['change'])

	const props = defineProps<Props>()

	const readOnly = false //是否只读
	const photoUrl = config.HTTP_REQUEST_URL //服务器图片域名或者ip
	const api = '/api/ajax/upload' //上传图片接口地址

	const saveContens = (e : any) => {
		emit('change', e.html)
	}
</script>

<style>
</style>